package cn.seaboot.admin.api.service;

import cn.seaboot.admin.api.bean.ApiAction;
import cn.seaboot.admin.api.dao.ApiActionDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Service
 * 接口分组 [t_api_group]
 *
 * @author Mr.css on 2018-6-20
 */
@Service
public class ApiActionService {

    @Resource
    private ApiActionDao apiActionDao;

    /**
     * 增
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int insert(ApiAction pojo) {
        return apiActionDao.insert(pojo);
    }

    /**
     * 删
     *
     * @param id id
     * @return affected rows
     */
    public int deleteById(String id) {
        return apiActionDao.deleteById(id);
    }

    /**
     * 删
     *
     * @param projectId 工程ID
     * @return affected rows
     */
    public int deleteByProjectId(String projectId) {
        return apiActionDao.deleteByProjectId(projectId);
    }

    /**
     * 改
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int updateById(ApiAction pojo) {
        return apiActionDao.updateSampleById(pojo);
    }

    /**
     * 查
     *
     * @param id id
     * @return pojo
     */
    public ApiAction queryById(String id) {
        return apiActionDao.selectById(id);
    }

    /**
     * 查列表
     *
     * @param params 参数
     * @return list
     */
    public List<ApiAction> queryList(Map<String, Object> params) {
        return apiActionDao.selectList(params);
    }
}
